package com.smarthome.common.tools;

import org.apache.commons.lang.StringUtils;

public class ApiCachedKeysUtil {

    private static final String NAME_SPACE = "smarthome:api:";
    public static final String MODULE_IPC_SESSION = "ipc:session:";
    public static final String MODULE_MOBILE_TOKEN = "mobile:token:";
    public static final String MODULE_IPC_THREADID = "ipc:threadId:";
    public static final String MODULE_IPC_IP = "ipc:ip:";

    public static final String AREA_PROVINCE ="areaProvince:";
    public static final String AREA_CITY = "areaCity:";
    public static final String AREA_DISTRICTS= "areaDistricts:";
    
    public static String getKey(String module, String key) {
        if (StringUtils.isBlank(module) || StringUtils.isBlank(key)) {
            throw new IllegalArgumentException("[Cache]the module and key cann't be blank.");
        }
        return String.format("%s_%s_%s", NAME_SPACE, module, key);
    }

}